﻿@model RedSand.Site.Models.CategoryInfo
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

<div class="dialog" title="Edit" style="width: 881px;">
    <div style="float:left;width:378px;border-right:1px solid #ccc">
        @using (Ajax.BeginForm(AdminAjaxOptions.UpdateRecord))
        {
            @Html.HiddenFor(model => model.ParentID)
            @Html.HiddenFor(model => model.CategoryID)
            <div class="dialog-content">
                <div class="form-cell none-float">
                    @Html.LabelFor(model => model.Name)
                    @Html.EditorFor(model => model.Name)
                </div>
                <div class="form-cell none-float">
                    @Html.LabelFor(model => model.Alias)
                    @Html.EditorFor(model => model.Alias)
                </div>
                <!--
                <div class="form-cell">
                    @Html.LabelFor(model => model.IsCustomPc)
                    @Html.DropDownListFor(model => model.IsCustomPc, new[] { new SelectListItem { Text = "No", Value = "false" }, new SelectListItem { Text = "Yes", Value = "true" } })
                </div>
                -->
                <div class="form-cell">
                    @Html.LabelFor(model => model.Order)
                    @Html.DropDownListFor(model => model.Order, DropDownListHelper.GetOrderList(Model.Order.Value))
                </div>
                <div class="form-cell">
                    @Html.LabelFor(model => model.Status)
                    @Html.DropDownListFor(model => model.Status, DropDownListHelper.GetStatusList(false))
                </div>
                <div class="clear">
                </div>
            </div>
            <div class="dialog-footer">
                <input type="submit" value="Save"/>
                <input type="button" value="Cancel" onclick="closeDialog('.dialog')" />
            </div>
        }
    </div>
    <div style="float:left;width:500px; " id="properties">
        @Html.Action("Properties", new { category = Model.CategoryID })
    </div>
</div>
<script type="text/javascript">
    if("@ViewBag.Create"){
        $.get("/category/list/@Model.ParentID/2", function (data) {
            $('#list-wrap').html(data);
            autoZen();
        });
    }

</script>
